/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface PuGeneral extends BasicModel<PuGeneral> {
  parentId?: string; // 父表ID
  vbillcode?: string; // 入库单号
  dbilldate?: string; // 入库日期
  wareName?: string; // 仓库名称
  busType?: string; // 业务流程
  busTypeName?: string; // 业务流程名称
  cgDeptId?: string; // 采购部门ID
  cgDeptName?: string; // 部门名称
  venId?: string; // 供应商id
  venName?: string; // 供应商名称
  vnote?: string; // 备注（表头）
  orerCode?: string; // 订单号
  orderDate?: string; // 订单日期
  invId?: string; // 存货基本ID
  crowno?: string; // 行号
  cinvcode?: string; // 存货编码
  cinvname?: string; // 存货名称
  cinvspec?: string; // 规格
  cinvtype?: string; // 型号
  measname?: string; // 单位名称
  cbatch?: string; // 批次号
  ninnum?: number; // 入库数量
  nprice?: number; // 无税单价
  nmny?: number; // 无税金额
  ntaxprice?: number; // 含税单价
  ntaxmny?: number; // 含税金额
  nictaxrate?: number; // 税率
  noritaxmny?: number; // 税额
  freplenishflag?: string; // 退货标志
  vnotebody?: string; // 备注（表体）
  currtypename?: string; // 币种
  pkCorp?: string; // 公司主键
  compName?: string; // 公司名称
  naccountnum1?: number; // 累计结算数量
}

export const puGeneralList = (params?: PuGeneral | any) =>
  defHttp.get<PuGeneral>({ url: adminPath + '/srm/cw/billvouch/puGeneral/list', params });

export const puGeneralListData = (params?: PuGeneral | any) =>
  defHttp.post<Page<PuGeneral>>({
    url: adminPath + '/srm/cw/billvouch/puGeneral/listData',
    params,
  });

export const puGeneralNeedKpListData = (params?: PuGeneral | any) =>
  defHttp.post<Page<PuGeneral>>({ url: adminPath + '/srm/cw/billvouch/puGeneral/needKpListData', params });

export const puGeneralForm = (params?: PuGeneral | any) =>
  defHttp.get<PuGeneral>({ url: adminPath + '/srm/cw/billvouch/puGeneral/form', params });

export const puGeneralSave = (params?: any, data?: PuGeneral | any) =>
  defHttp.postJson<PuGeneral>({
    url: adminPath + '/srm/cw/billvouch/puGeneral/save',
    params,
    data,
  });

export const puGeneralPreDataSave = (params?: any, data?: PuGeneral | any) =>
  defHttp.postJson<PuGeneral>({ url: adminPath + '/srm/cw/prekp/puGeneralPreData/save', params, data });

export const puGeneralPreDataListData = (params?: PuGeneral | any) =>
  defHttp.post<Page<PuGeneral>>({ url: adminPath + '/srm/cw/prekp/puGeneralPreData/listData', params });


export const puGeneralDelete = (params?: PuGeneral | any) =>
  defHttp.get<PuGeneral>({ url: adminPath + '/srm/cw/billvouch/puGeneral/delete', params });
